package homework3;

import java.io.*;

public class Test3 {
    public static void main(String[] args) {
        File dir = new File("./src/io");

        if (dir.isDirectory()) {
            File[] subs = dir.listFiles(f -> f.getName().endsWith(".java"));
            for (int i = 0; i < subs.length; i++) {
                File file = subs[i];
                try (
                     FileInputStream fis = new FileInputStream(file);
                     InputStreamReader isr = new InputStreamReader(fis);
                     BufferedReader br = new BufferedReader(isr)
                ) {
                    String line;
                    while ((line = br.readLine()) != null) {
                        System.out.println(line);
                    }
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

            }

        }
    }
}
